package com.ougy.reshop.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
public class Album {
	private int id;
	private String album_name;
	private int album_sequence;
	private List<Accessory> photos = new ArrayList<Accessory>();
	private Accessory album_cover;
	private String album_info;
	private User user;
	
	@Id @GeneratedValue
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getAlbum_name() {
		return album_name;
	}
	public void setAlbum_name(String album_name) {
		this.album_name = album_name;
	}
	public int getAlbum_sequence() {
		return album_sequence;
	}
	public void setAlbum_sequence(int album_sequence) {
		this.album_sequence = album_sequence;
	}
	
	@OneToMany(mappedBy="album",cascade={CascadeType.ALL})
	public List<Accessory> getPhotos() {
		return photos;
	}
	public void setPhotos(List<Accessory> photos) {
		this.photos = photos;
	}
	
	@OneToOne
	public Accessory getAlbum_cover() {
		return album_cover;
	}
	public void setAlbum_cover(Accessory album_cover) {
		this.album_cover = album_cover;
	}
	@Column(columnDefinition="text")
	public String getAlbum_info() {
		return album_info;
	}
	public void setAlbum_info(String album_info) {
		this.album_info = album_info;
	}
	@ManyToOne
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
}
